package com.wangzifan.mapper;

import com.wangzifan.entity.Grade;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface GradeMapper {

    List<Grade> queryGrade(String sno, String cno);

//    @Select("select grade.id,grade.sno,grade.cno,grade.score from grade,course where grade.cno=course.cno and tno=#{tno}")
//    Grade queryGradeByTno(String tno);

    void deleteGrade(List<Integer> ids);

    @Insert("insert into grade(sno, cno, score) values (#{sno},#{cno},#{score})")
    void addGrade(Grade grade);

    void updateGrade(Grade grade);

    @Select("select * from grade where id=#{id}")
    Grade queryGradeById(Integer id);

    List<Grade> queryGradeByTeacher(String tno, String cno);
}
